<%inherit file="/layouts/base.html"/>
<%def name="title()">Run TestRun</%def>
<%def name="head()">
</%def>

${h.secure_form(url('runtest', name=c.name), method="GET")}
<h2>Filter By</h2>
<ul>
    <li>
    Platform: 
    ${h.select(name="platform", selected_values=None, options=c.all_platforms)} 
    </li>
    <li>TestSuites:
    ${h.select(name="testsuite", selected_values=None, options=c.all_testsuites)}    
    </li>
    <li>Success:
    ${h.select(name="result", selected_values=None, options=['success', 'failure'], prompt="--Any--")}    
    </li>
    <li>Open Only: 
    ${h.checkbox(name="open_only", checked=c.open_only)}
    </li>
</ul>
${h.submit(value="Filter", name="commit")}
${h.end_form()}

${h.secure_form(url('batch_testrun'))}
<table id="runtest-table">
    <tr>
        <th class="instruction">Instruction</th>
        <th class="expected_result">Expected Result</th>
        <th class="result">Result</th>
    </tr>
% for case in c.cases:
    <tr>
        <td colspan="3" class="summary">${case.summary} (<strong>${case.testsuite.name}</strong>, ${case.platform})</td>
    </tr>
    <tr class="case-closed-${case.closed}">
        <td class="instruction">${h.textile(case.instruction) | n}</td>
        <td class="expected_result">${h.textile(case.expected_result) | n}</td>
        <td class="result">
            <span class="remarks">
            Remarks:
            ${h.text("remarks-" + str(case.key()), value=case.remarks, class_="remarks")}
            </span>
            <span class="success">
            Success:
            ${h.select(name="success-" + str(case.key()), selected_values=case.success, options=["True", "False"], prompt="--Pending--", class_="success")}
            </span>
        </td>
    </tr>
% endfor
</table>
${h.submit(value="Batch Update", name="commit")}
${h.end_form()}